The $lang parameter defaults to false, but Message::inLanguage() doesn't
like false, so do an explicit check for false.
Change-Id: I66fb2d11269a988ae92b1594314807a4eed54f1b
* @return String: full html of the TOC
*/
public static function tocList( $toc, $lang = false ) {
- $title = wfMessage( 'toc' )->inLanguage( $lang )->escaped();
+ $msg = wfMessage( 'toc' );
+ if ( $lang !== false ) {
+ $msg = $msg->inLanguage( $lang );
+ }
+ $title = $msg->escaped();
return
'<table id="toc" class="toc"><tr><td>'
. '<div id="toctitle"><h2>' . $title . "</h2></div>\n"